package com.minglead.springboot.platform.sys.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.minglead.springboot.common.crud.CrudService;
import com.minglead.springboot.common.persistence.Page;
import com.minglead.springboot.platform.sys.dao.DesktopPlugDao;
import com.minglead.springboot.platform.sys.entity.DesktopPlug;


/**
 * 桌面插件Service
 * @author clz
 * @version 2017-09-05
 */
@Service
@Transactional(readOnly = true)
public class DesktopPlugService extends CrudService<DesktopPlugDao, DesktopPlug> {

	public DesktopPlug get(String id) {
		return super.get(id);
	}
	
	public List<DesktopPlug> findList(DesktopPlug desktopPlug) {
		return super.findList(desktopPlug);
	}
	
	public Page<DesktopPlug> findPage(Page<DesktopPlug> page, DesktopPlug desktopPlug) {
		return super.findPage(page, desktopPlug);
	}
	
	@Transactional(readOnly = false)
	public void save(DesktopPlug desktopPlug) {
		super.save(desktopPlug);
	}
	
	@Transactional(readOnly = false)
	public void delete(DesktopPlug desktopPlug) {
		super.delete(desktopPlug);
	}

	public void wrapEntity(DesktopPlug d) {
		String w = d.getWidth()==null?"?":d.getWidth()+"";
		String h = d.getHeight()==null?"?":d.getHeight()+"";
		d.setWidthHeight(w+"*"+h);
	}
}